Host apparatus and information processing system using the same

ABSTRACT

In an information processing system, a host apparatus and a device are communicatively connected such that the host apparatus serves as a master and the device serves as a slave. The device is configured to establish a power-saving mode, when any command is not received from the host apparatus for a prescribed time period. A device driver is provided in the host apparatus. The device driver is configured to transit from a normal state to a suspended state when an operation command for operating the device is not received from an application running in the host apparatus for a prescribed time period, and to transmit a dummy response to the application, when an inquiry command is received from the application while the device driver is placed in the suspended state, without notifying the inquiry command to the device.

This application is a continuation of U.S. application Ser. No.12/755,748 filed on Apr. 7, 2010, which claims priority to U.S.application Ser. No. 11/606,710, filed on Nov. 29, 2006 (U.S. Pat. No.7,721,131), whose priority is claimed from Japanese Patent Application2005-345390 filed on Nov. 30, 2005, which is hereby incorporated byreference in its entirety.

BACKGROUND

1. Technical Field

The present invention relates to a technique for activating a device ina power-saving mode when a host apparatus and a device are connectedtogether by a communication system which assigns the host apparatus as amaster and the device as a slave.

2. Related Art

A device, such as a printer, connected to a host apparatus establishes apower-saving mode when there is no access from the host apparatus over aprescribed time period. Such a configuration is disclosed in, forexample, International Patent Publication No. WO00/28402.

However, when the host apparatus and the device are connected to eachother by a USB (Universal Serial Bus), the following problems arise.Specifically, according to the USB, communication is effected while thehost apparatus is acts as a master and the device acts as a slave.Accordingly, the host apparatus in principle causes the device to check,at a short cycle, a status and whether or not a request to the hostapparatus is present.

Therefore, the device connected to the host apparatus by the USBfrequently receives inquiries from the host apparatus, which hinders thedevice from establishing a power-saving mode.

SUMMARY

It is therefore one advantageous aspect of the invention is to save thepower that is consumed by the device when a host apparatus and a deviceare connected together under a communication system in which the hostapparatus acts as a master and the device acts as a slave.

According to one aspect of the invention, there is provided aninformation processing system, comprising:

a host apparatus, serving as a master;

a device, communicatively connected to the host apparatus and serving asa slave, the device being configured to establish a power-saving mode,when a command is not received from the host apparatus for a prescribedtime period; and

a device driver, provided in the host apparatus, the device driver beingconfigured to transit from a normal state to a suspended state when anoperation command for operating the device is not received from anapplication running in the host apparatus for a prescribed time period,and to transmit a dummy response to the application, when an inquirycommand is received from the application while the device driver isplaced in the suspended state, without notifying the inquiry command tothe device.

The information processing system may further comprises: a USB devicecontroller, provided in the device; and a USB host controller, providedin the host apparatus and adapted to perform communications, by way of aUSB, with the USB device controller.

The device driver may be configured to transit from the suspended modeto the normal mode, when the USB host controller receives a resumesignal from the USB device controller.

The device may be a printer. Here, the inquiry command may include acommand for inquiring a status of the printer and a command forinquiring a presence of a request from the printer to the hostapparatus. The operation command may be a command for causing theprinter to perform printing.

According to one aspect of an embodiment of the invention, there isprovided a host apparatus, adapted to serve as a master in a case wherethe host apparatus is communicatively connected to a device serving as aslave and configured to establish a power-saving mode, when any commandis not received from the host apparatus for a prescribed time period,the host apparatus comprising:

a device driver, configured to be placed in a suspended state when anoperation command for operating the device is not received from anapplication running in the host apparatus for a prescribed time period,and to transmit a dummy response to the application, when an inquirycommand is received from the application while the device driver isplaced in the suspended state, without notifying the inquiry command tothe device.

According to one aspect of an embodiment of the invention, there isprovided a power saving method executed in an information processingsystem in which a host apparatus and a device are communicativelyconnected such that the host apparatus serves as a master and the deviceserves as a slave, the method comprising:

running an application in the host apparatus;

placing the host apparatus in a suspended state when an operationcommand for operating the device is not received from the application;

transmitting a dummy response to the application, when an inquirycommand is received from the application while the device driver isplaced in the suspended state, without notifying the inquiry command tothe device; and

establishing a power-saving mode of the device when the device receivesno command from the host apparatus for a prescribed time period.

According to one aspect of the invention, there is provided a programproduct comprising a computer-readable medium recording a programcausing a computer to execute the above method.

BRIEF DESCRIPTION OF THE DRAWINGS

These and other aspects and advantages of the present invention will bedescribed in detail with reference to the accompanying drawings.

FIG. 1 is a block diagram showing an information processing systemaccording to one embodiment of the invention.

FIG. 2 is a flowchart showing a processing executed by a device in theinformation processing system.

FIG. 3 is a flowchart showing a processing executed when the device isin a suspended state.

FIG. 4 is a flowchart showing a recovery processing executed when thedevice is recovered from the suspended state.

DETAILED DESCRIPTION OF EXEMPLARY EMBODIMENTS

Exemplary embodiments of the invention will be described below in detailwith reference to the accompanying drawings.

FIG. 1 shows a print system 1 according to one embodiment of the presentinvention when a printer is used as a device.

The print system 1 comprises a host apparatus 10 and a printer 20.Communication is effected between the host apparatus 10 and the printer20 by the USB (Universal Serial Bus).

The host apparatus 10 is provided as, for example, a general-purposecomputer system. Individual constituent elements or functions in thehost apparatus 10, which will be described below, are realized byexecuting a computer program.

The host apparatus 10 comprises an application 11 such as a printerdriver, a device driver 12, and a USB host controller 14.

The device driver 12 controls a printer 20 serving as a device. Thedevice driver 12 also has a timer 121. When waiting for a request, suchas a command, from the application 11, the timer 121 measures a timeperiod which has elapsed from when a previous request from theapplication 11 was received.

As will be described later, when a request, such as a print request, isnot issued for a prescribed time period, the device driver 12 is placedin a suspended state. Accordingly, the device driver 12 has a suspendflag 122 showing whether or not the current state is a suspended state.

The USB host controller 14 establishes, as a USB host, communicationwith the printer 20 serving as a USB device. Specifically, the USB hostcontroller 14 establishes communication with a USB device controller 21provided in the USB device.

For instance, when the application 11 outputs a print request, a printerstatus inquiry command, a data request command, and the like, the devicedriver 12 receives the output and notifies the printer 20 of the outputas a request by way of the USB host controller 14.

The application 11 issues, at a prescribed cycle, an inquiry commandsuch as a status inquiry command, a data request command, and the like.This is attributable to the master-slave relationship existing betweenthe host apparatus and the printer. Specifically, when communication iseffected while maintaining the master-slave relationship as in the caseof the USB, the slave in principle cannot voluntarily transmitinformation, and responds to a request from the host apparatus.Accordingly, the host apparatus 10 serving as a master must periodicallysend an inquiry command to the printer 20 serving as a slave, to thusacquire data or a request from the printer 20.

The printer 20 comprises the USB device controller 21, a CPU 22controlling the entirety of the printer 20, and a printing mechanism 29having a print head and a sheet feeding mechanism.

The USB device controller 21 operates as a slave to the USB hostcontroller 14, and effects communication complying with the USBstandards.

For instance, when the USB device controller 21 receives a print requestfrom the USB host controller 14, the printing mechanism 29 performs aprinting operation after the CPU 22 has performed prescribed processing.Moreover, upon receipt of a status inquiry command from the hostapparatus 10 by way of the USB device controller 21, the CPU 22 returnsthe status of the printer 20 achieved at that time. Alternatively, uponreceipt of a data request command from the host apparatus 10, the USBdevice controller 21 notifies the USB host controller 14 of that requestso long as there is any request, such as a data transfer, to the hostapparatus 10.

In this embodiment, when a request from the host apparatus 10 is notreceived for a prescribed time period, the printer 20 establishes apower-saving mode. Here, the power consumed by; e.g., the CPU 22 and theprinting mechanism 29, is saved.

When USB communication is used between the host apparatus and theprinter, an inquiry command is periodically transmitted from the hostapparatus 10. Hence, the printer 20 cannot establish the power-savingmode. Accordingly, the device driver 12 saves the power consumed by theprinter 20 in the following manner.

As shown in FIG. 2, the device driver 12 first causes the timer 121 tostart, and sets the suspend flag 122 to zero, to thus performinitialization (S11). Next, the device driver 12 determines whether ornot the suspend flag 122 is one (S12).

When the suspend flag 122 assumes a value of one (when. Yes is selectedin S12), the device driver 12 performs suspending processing, andreturns to step S12 (S20). The suspending processing will be describedlater.

When the suspend flag 122 is not one (when No is selected in S12), thedevice driver 12 determines whether or not any request from theapplication 11 has been received (S13).

When a request has been received (when Yes is selected in S13),processing complying with a received request is performed (S16).Moreover, when the executed request corresponds to an inquiry commandsuch as a status inquiry command from the printer 20 or a data requestcommand to the printer 20 (when Yes is selected in S17), processingimmediately returns to step S12. When the executed request does notcorrespond to the inquiry command (when No is selected in S17),processing returns to step S12 after the timer 121 has been cleared. Forinstance, when a print request command has been received, the timer 121is cleared.

When the request has not been received in step S13 (when No is selectedin S13), the device driver 12 determines whether or not a time measuredby the timer 121 has elapsed a prescribed time period and a time-out hascome (S14). When a time-out has not come (when No is selected in S14),processing returns to step S12.

In the meantime, when a time-out has come in step S14 (when Yes isselected in S14), the device driver 12 sets the suspend flag 122 to one,and establishes a suspended state (S15).

Next, the suspending processing of the device driver 12 will bedescribed with reference to FIG. 3.

The device driver 12 determines whether or not any request from theapplication 11 has been received (S21). When no request has beenreceived (when No is selected in S21), suspending processing isterminated.

When the request has been received (when Yes is selected in S21), adetermination is made as to whether or not the received commandcorresponds to the inquiry command (S22).

When the received command corresponds to the inquiry command (when Yesis selected in S22), a dummy response corresponding to the inquirycommand is returned to the application 11, and terminates the suspendingprocessing (S27). For instance, a dummy response to the status inquirycommand may be a response showing a normal status. Further, a dummyresponse to the data request command may be a response not having data.

Thus, in the suspended state, the device driver 12 returns a dummyresponse to an inquiry command periodically output from the application11, and does not notify the printer 20 of the inquiry command.Accordingly, so long as a command other than the inquiry command is notissued by the application 11, the printer 20 is not notified of thecommand. When this state has continued for a while, the USB hostcontroller 14 and the USB device controller 21 proceed to the suspendedstate, and the printer 20 also establishes a power-saving mode.

When the command received in step S22 does not correspond to an inquirycommand (when No is selected in S22), the device driver 12 outputs, tothe USB host controller 14, a return command used for returning the USBhost controller 14 and the USB device controller 21 from the suspendedstate (S23).

Upon receipt of the return command, the USB host controller 14 returnsthe USB device controller 21 to a normal state, and restores itself intoa normal state. When the USB device controller 21 has returned to anormal state, the entire printer 20 also returns from the power-savingmode to the normal mode.

The device driver 12 waits for a return completion response from the USBhost controller 14, and performs processing for executing the receivedrequest (S24, S25). Concurrently, the device driver 12 sets the suspendflag 122 to zero; clears the timer 121; and terminates suspendingprocessing (S26).

Thus, even when the inquiry command periodically issued by theapplication 11 has been received, the USB host controller 14 and the USBdevice controller 12 are held in a suspended state. Consequently, theprinter 20 can be continually held in a power-saving mode. In themeantime, when a command for activating the printer, such as a printrequest, has been issued by the application 11, the printer 20 canquickly return to a normal state and can execute the command.

When an event requiring notification of a change in status to the hostapparatus 10 has occurred while the printer 20 is in the power-savingmode, the printer 20 returns to a normal state according to thefollowing procedures.

FIG. 4 shows procedures for returning the printer 20 to the normal statein association with occurrence of an event.

First, when a prescribed event has occurred in the printer 20, the CPU22 of the printer 20 returns from the power-saving mode to the normalmode (S31, S32). Moreover, the USB device controller 21 following theCPU 22 returns from the suspended state, and outputs a resume signal tothe USB host controller 14 (S33).

The USB host controller 14 having received a resume signal from the USBdevice controller 21 returns from the suspended state; and sends, to thedevice driver 12, a call-back showing that the USB host controller 14has returned from the suspended state (S34, S35).

Upon receipt of the call-back, the device driver 12 sets the suspendflag 122 to zero, and returns from the suspended state (S36).

Consequently, the inquiry command issued by the application 11 from thenon is notified to the printer 20 until a time-out comes. Consequently,the application 11 can ascertain a change having occurred in the statusof the printer 20.

Although only some exemplary embodiments of the invention have beendescribed in detail above, those skilled in the art will readilyappreciate that many modifications are possible in the exemplaryembodiments without materially departing from the novel teachings andadvantages of the invention. Accordingly, all such modifications areintended to be included within the scope of the invention.

For instance, this embodiment has described a combination of the hostapparatus with the printer. However, the present invention can beapplied to a device other than the printer. Moreover, communicationestablished between the host apparatus and the device is not limited tothe USB scheme. The present invention can be applied to anycommunication system, so long as communication is established while ahost apparatus is taken as a master and a device is taken as a slave.

What is claimed is:
 1. An information processing system, comprising: ahost apparatus, serving as a master; a device, communicatively connectedto the host apparatus and serving as a slave, the device beingresponsive to commands including operation commands for operating thedevice and inquiry commands from the host apparatus and being configuredto establish a power-saving mode when no command is received from thehost apparatus for a first prescribed time period; and a device driver,provided in the host apparatus, the device driver being configured totransit from a normal state to a suspended state when no operationcommand for operating the device is received for a second prescribedtime period, wherein: the device driver returns a dummy response, whenthe device driver receives an inquiry command while the device driver isplaced in the suspended state, without notifying the inquiry command tothe device, and the device driver outputs a return command to the devicefor returning the device from the power-saving mode when the devicedriver receives a command other than the inquiry command while thedevice driver is placed in the suspended state.
 2. The informationprocessing system as set forth in claim 1, wherein: the host apparatushas a USB host controller and serves as a master of a USB communication,the device has a USB device controller communicatively connected to theUSB host controller of the host apparatus via a USB interface, andserves as a slave of the USB communication, and the device driveroutputs the return command to the USB host controller for returning theUSB host controller and the USB device controller from the suspendedstate and returning the device from the power-saving mode when thedevice driver receives the command other than the inquiry command whilethe device driver is placed in the suspended state.
 3. The informationprocessing system as set forth in claim 2, wherein: the USB devicecontroller outputs a resume signal to the USB host controller when thedevice returns from the power-saving mode in response to the returncommand, and the device driver transits from the suspended state to thenormal state when the USB host controller receives the resume signalfrom the USB device controller.
 4. The information processing system asset forth in claim 1, wherein: the device is a printer; and the inquirycommand includes a command for inquiring a status of the printer or acommand for inquiring a presence of a request from the printer to thehost apparatus.
 5. The information processing system as set forth inclaim 1, wherein: the device is a printer; and the operation command isa command for causing the printer to perform printing.
 6. A hostapparatus, adapted to serve as a master when the host apparatus iscommunicatively connected to a device serving as a slave, the devicebeing responsive to commands including operation commands for operatingthe device and inquiry commands from the host apparatus and beingconfigured to establish a power-saving mode when no command is receivedfrom the host apparatus for a first prescribed time period, the hostapparatus comprising: a device driver, configured to be placed in asuspended state when no operation command for operating the device isreceived for a second prescribed time period, wherein: the device driverreturns a dummy response, when the device driver receives an inquirycommand while the device driver is placed in the suspended state,without notifying the inquiry command to the device, and the devicedriver outputs a return command to the device for returning the devicefrom the power-saving mode when the device driver receives a commandother than the inquiry command while the device driver is placed in thesuspended state.
 7. A power saving method executed in an informationprocessing system in which a host apparatus and a device arecommunicatively connected such that the host apparatus serves as amaster and the device serves as a slave, the device being responsive tocommands including operation commands for operating the device andinquiry commands from the host apparatus, the method comprising: placingthe host apparatus in a suspended state when no operation command foroperating the device is received for a first prescribed time period;returning a dummy response, when receiving an inquiry command while thehost apparatus is placed in the suspended state, without notifying theinquiry command to the device; establishing a power-saving mode of thedevice when the device receives no command from the host apparatus for asecond prescribed time period; and outputting a return command to thedevice for returning the device from the power-saving mode whenreceiving a command other than the inquiry command while the hostapparatus is placed in the suspended state.
 8. A program productcomprising a non-transitory computer-readable medium recording a programcausing a computer to execute a method comprising: placing a hostapparatus which serves as a master in a suspended state when nooperation command for operating a device which is communicativelyconnected to the host apparatus and serves as a slave is received for afirst prescribed time period; returning a dummy response, when receivingan inquiry command while the device driver is placed in the suspendedstate, without notifying the inquiry command to the device; establishinga power-saving mode of the device when the device receives no commandfrom the host apparatus for a second prescribed time period; andoutputting a return command to the device for returning the device fromthe power-saving mode when receiving a command other than the inquirycommand while the host apparatus is placed in the suspended state.